package com.tom.imooc.controller;

import com.tom.imooc.properties.DynamicDataSourceProperty;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zx
 * @date 2024-09-05 12:42
 */
@RestController
@RequestMapping("/test")
public class TestController {


    @Setter(onMethod_= @Autowired)
    private DynamicDataSourceProperty dynamicDataSourceProperty;

    /**
     * 获取动态数据源配置信息
     *
     * @return 当前配置的动态数据源信息 {@link DynamicDataSourceProperty}
     */
    @GetMapping("/getDynamicDataSourcePropertyInfo")
    public DynamicDataSourceProperty getDynamicDataSourcePropertyInfo() {
        return dynamicDataSourceProperty;
    }
}
